/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.persistencia.domain;

import java.io.Serializable;
import javax.persistence.*;
import javax.validation.constraints.Size;

/**
 *
 * @author kenny
 */
@Entity
@Table(name = "maestro")
@NamedQueries({
    @NamedQuery(name = "Maestro.findAll", query = "SELECT m FROM Maestro m"),
    @NamedQuery(name = "Maestro.findByIdMstId", query = "SELECT m FROM Maestro m WHERE m.maestroPK.idMstId = :idMstId"),
    @NamedQuery(name = "Maestro.findByIdMstItmId", query = "SELECT m FROM Maestro m WHERE m.maestroPK.idMstItmId = :idMstItmId"),
    @NamedQuery(name = "Maestro.findByVDescripcion", query = "SELECT m FROM Maestro m WHERE m.vDescripcion = :vDescripcion"),
    @NamedQuery(name = "Maestro.findByNValor", query = "SELECT m FROM Maestro m WHERE m.nValor = :nValor"),
    @NamedQuery(name = "Maestro.findByNOrden", query = "SELECT m FROM Maestro m WHERE m.nOrden = :nOrden"),
    @NamedQuery(name = "Maestro.findByVEstado", query = "SELECT m FROM Maestro m WHERE m.vEstado = :vEstado")})
public class Maestro implements Serializable {
    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected MaestroPK maestroPK;
    @Size(max = 60)
    @Column(name = "vDescripcion")
    private String vDescripcion;
    @Column(name = "nValor")
    private Integer nValor;
    @Column(name = "nOrden")
    private Integer nOrden;
    @Size(max = 1)
    @Column(name = "vEstado")
    private String vEstado;

    public Maestro() {
    }

    public Maestro(MaestroPK maestroPK) {
        this.maestroPK = maestroPK;
    }

    public Maestro(int idMstId, int idMstItmId) {
        this.maestroPK = new MaestroPK(idMstId, idMstItmId);
    }

    public MaestroPK getMaestroPK() {
        return maestroPK;
    }

    public void setMaestroPK(MaestroPK maestroPK) {
        this.maestroPK = maestroPK;
    }

    public String getVDescripcion() {
        return vDescripcion;
    }

    public void setVDescripcion(String vDescripcion) {
        this.vDescripcion = vDescripcion;
    }

    public Integer getNValor() {
        return nValor;
    }

    public void setNValor(Integer nValor) {
        this.nValor = nValor;
    }

    public Integer getNOrden() {
        return nOrden;
    }

    public void setNOrden(Integer nOrden) {
        this.nOrden = nOrden;
    }

    public String getVEstado() {
        return vEstado;
    }

    public void setVEstado(String vEstado) {
        this.vEstado = vEstado;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (maestroPK != null ? maestroPK.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Maestro)) {
            return false;
        }
        Maestro other = (Maestro) object;
        if ((this.maestroPK == null && other.maestroPK != null) || (this.maestroPK != null && !this.maestroPK.equals(other.maestroPK))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.persistencia.domain.Maestro[ maestroPK=" + maestroPK + " ]";
    }
    
}
